package com.caigou.controller;

import com.caigou.bean.cms.entity.OperationLog;
import com.caigou.bean.cms.entity.PictureFolder;
import com.caigou.bean.cms.param.OperationLogParam;
import com.caigou.bean.exam.entity.Users;
import com.caigou.enums.ResponseEnum;
import com.caigou.security.utils.CurrentUser;
import com.caigou.service.OperationLogService;
import com.caigou.util.Result;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/operationLog")
public class OperationLogController {
    @Resource
    private OperationLogService operationLogService;

    @RequestMapping("queryOperationLog")
    @PreAuthorize("hasAnyAuthority('gaojiankuchaxun')")
    public Result queryOperationLog(@RequestBody OperationLogParam operationLogParam, @CurrentUser Users user){
        PageInfo<OperationLog> operationLogPageInfo = operationLogService.queryOperationLog(operationLogParam);
        return Result.success(operationLogPageInfo);
    }


}
